﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ARR.Entities;
using ARR.Services.Domain;
using DDF.Entity;


namespace ARR.Services
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "StoreService" in both code and config file together.
    public class StoreService : IStoreService
    {
        public List<Store> GetAll(bool lazyLoad)
        {
            List<Store> stores = StoresDomain.GetAll(lazyLoad);

            foreach (Store st in stores)
            {
                st.ChangeState(EntityState.Original);
            }

            return stores;
        }

        public List<Store> GetByCountry(int countryId, bool lazyLoad)
        {
            return StoresDomain.GetByCountry(countryId ,lazyLoad);
        }

        public void DeleteStores(List<Store> stores)
        {
            StoresDomain.DeleteStores(stores);
        }

        public void Save(List<Store> stores)
        {
            StoresDomain.SaveStores(stores);
        }

        public void SaveTempStores(List<TempStore> stores)
        {
            StoresDomain.SaveTempStores(stores);
        }
    }
}
